package xcu.lxj.nettychat.websocket.netty;

import lombok.Data;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @Author XinJian Lei
 * @Date 2024/9/15 16:38
 * @Version 1.0
 */

@Data
@ConfigurationProperties(prefix = "netty")
@ConditionalOnProperty(prefix = "netty",name = "enabled",havingValue = "true",matchIfMissing = true)
public class NettyProperties {

   /**
    *  是否开启netty
    */
   private boolean enabled;
   /**
    *  netty服务端口号
    */
   private int port = 9000;
   /**
    * websocket连接需要的uri
    * 案例: /ws
    */
   private String webSocketUri = "/ws";
   /**
    * 读空闲
    * 单位: 秒
    */
   private int readerIdleTimeSeconds = 30;
   /**
    * 写空闲
    * 单位: 秒
    */
   private int writerIdleTimeSeconds = 0;
   /**
    * 读写空闲时间
    * 单位: 秒
    */
   private int allIdleTimeSeconds = 0;

}
